<table style="width: 100%;" cellpadding="4" cellspacing="0">
<tr>
    <td class="border2">
        <table style="width: 100%;" class="mainmenu5" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td width="7"><img src="design/pic/spacer.gif" class="sqr1" alt="" height="7" width="7" /></td>
            <td class="block_header">{language text="take_quiz"}</td>
        </tr>
        </table>

    {if !$aResults}
        <table style="width:100%;" cellpadding="5">
            <tr>
                <td style="font-size:8pt;" class="color">
                {messages block="TakeQuiz"}
                <table cellspacing="0" cellpadding="8">
                    <tr>
                        <td style="vertical-align:top;font-size:8pt;">
                            <a href="{url link='public.user' name=$aQuiz.user}">
                                {Account::Avatar sUser=$aQuiz.user iSize=75 class="pic1" onmouseover="showInfo5('`$aQuiz.user`', '', '');this.className='pic2';" onmouseout="this.className='pic1';return nd();"}
                            </a>
                        </td>
                        <td style="vertical-align:top;font-size:8pt;" class="color">
                        <span class="color" style="font-size:9pt;"> <b><u>{$aQuiz.title|escape}</u></b></span> <br />
                            <br />
                            <i>{language text="created_by"}:</i> {$aQuiz.user}<br />
                            <i>{language text="views"}:</i> {$aQuiz.views}<br />

                            <i>{language text="last_taken_by_1177"}:</i>
                            {if $aQuiz.player}
                            <a href="{url link='public.user' name=$aQuiz.player}">{$aQuiz.player}</a> {language text="scored"} {$aQuiz.points|string_format:"%0.1f"}% {language text="right"}
                            {else}
                            {language text="not_taken_yet"}
                            {/if}
                            {if $bIsOwner}
                            <br />
                            <a href="{url link='public.quiz.all-results' id=$aQuiz.id}">{language text="view_all_results"}</a>
                            {/if}
                            <br />
                        </td>
                    </tr>
                </table>

                </td>
            </tr>
        </table>
        <br />
        <br />
        <br />
        <div style="padding-left:30px;">

        <form method="post" action="{$sUrl}" name="form">
        {foreach from=$aQuestions item=aQuestion name=questions}
        <table style="width:100%;">
            <tr>
                <td style="font-size:8pt;" class="color"><b>{$smarty.foreach.questions.iteration}. {$aQuestion.q1|escape}</b>
                <div style="padding-left:15px;">
                {if $aQuestion.a1}<div style="font-size:8pt;"><input type="radio" id="answer_{$aQuestion.id}_1" name="aAnswer[{$aQuestion.id}]" value="{$aQuestion.a1|escape}" style="border:0px;" checked="checked"/> <label for="answer_{$aQuestion.id}_1" style="cursor:pointer;"> {$aQuestion.a1|escape}</label></div>{/if}
                {if $aQuestion.a2}<div style="font-size:8pt;"><input type="radio" id="answer_{$aQuestion.id}_2" name="aAnswer[{$aQuestion.id}]" value="{$aQuestion.a2|escape}" style="border:0px;" /> <label for="answer_{$aQuestion.id}_2" style="cursor:pointer;"> {$aQuestion.a2|escape}</label></div>{/if}
                {if $aQuestion.a3}<div style="font-size:8pt;"><input type="radio" id="answer_{$aQuestion.id}_3" name="aAnswer[{$aQuestion.id}]" value="{$aQuestion.a3|escape}" style="border:0px;" /> <label for="answer_{$aQuestion.id}_3" style="cursor:pointer;"> {$aQuestion.a3|escape}</label></div>{/if}
                {if $aQuestion.a4}<div style="font-size:8pt;"><input type="radio" id="answer_{$aQuestion.id}_4" name="aAnswer[{$aQuestion.id}]" value="{$aQuestion.a4|escape}" style="border:0px;" /> <label for="answer_{$aQuestion.id}_4" style="cursor:pointer;"> {$aQuestion.a4|escape}</label></div>{/if}
                </div>
                </td>
            </tr>
        </table>
        <br />
        {/foreach}
        <table style="width:100%;" class="red">
            <tr>
                <td style="font-size:7pt;" class="memlink">
                    <input type="submit" name="act[quiz_post_answers]" value="{language text="submit_the_quiz"}" style="cursor:pointer;" />
                </td>
            </tr>
        </table>
        </form>
        </div>
        <br /><br />
    {else}
    <table style="width:100%;">
        <tr>
            <td style="font-size:8pt;" class="color">
            <div style="font-size:8pt;padding-left:20px;" class="color"><b>{language text="quiz_1165"}:</b> {$aQuiz.title|escape}<br />
            <b>{language text="user_292"}:</b> {$aResults.user1}<br />
            <b>{language text="score"}:</b> {$aResults.score}<br />
            <br />
            <div style="font-size:7pt;" class="memlink"><a class="link_action" href="{url link='public.quiz.all-results' id=$aQuiz.id}">[ {language text="view_all_resilts"} ]</a></div>
            </div>
            <br /><br />

            {foreach from=$aResults.results item=aAnswer name=answers}
            <div style="padding-left:20px;">
            {if $aAnswer.a1 == $aAnswer.a2}
                <img src="design/pic/donate.gif" style="vertical-align:middle;" alt="" />
            {else}
                <img src="design/pic/warning.gif" style="vertical-align:middle;" alt="" />
            {/if}
            <b>{$smarty.foreach.answers.iteration}. {$aAnswer.q|escape} </b><br />
            <br />
            <div style="padding-left:20px;">
            <b>{$aResults.user1} {language text="answered"}:</b> {$aAnswer.a1|escape} <br />
            <b>{language text="correct_answer"}:</b> {$aAnswer.a2|escape}</div>
            </div>
            <br />
            {/foreach}

            </td>
        </tr>
    </table>
    {/if}
    </td>
</tr>
</table>